<?php
session_start();
$_SESSION["username"] = "";
include '../inc/connect_db.php';
$username = "";
$password = "";
if(isset($_POST["username"])){
	$username = $_POST["username"];
}
if(isset($_POST["password"])){
	$password = $_POST["password"];
}
$sql = "SELECT * FROM tb_user WHERE user_login_name='$username' AND user_password='$password' ";
$query = mysql_query($sql);
$data_count = mysql_num_rows($query);
while ($data = mysql_fetch_array($query)) {
	$_SESSION["user_id"] = $data["user_id"];
}
if($data_count>0){
	echo "1";
	$_SESSION["username"] = $username;
}else {
	echo "0";
}




